package StudyCode.summary.myfile;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.PosixFilePermission;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class FilesSetAttribute {
	public static void main(String[] args) {
		Path path = Paths.get("E:\\迅雷下载\\test1.txt");
		try {
			Files.setAttribute(path, "posix:permission", PosixFilePermission.OTHERS_WRITE);
			System.out.println("设置 PosixFilePermission 属性成功。");
		} catch (Exception ex) {
			System.out.println("设置 PosixFilePermission 属性失败。");
		}
	}
}
